<html>
<head>
<title>{TITLE}</title>

<link rel="stylesheet" href="css/elgu.css" type="text/css">

<script language="javascript">

  function validateForm(iform) {

  	if (iform.userType.value=="") {
		alert("userType required.");
		iform.userType.focus();
		return false;
	}
	if (iform.username.value=="") {
		alert("username Required.");
		iform.username.focus();
		return false;
	}
	if (iform.password.value=="") {
		alert("password Required.");
		iform.password.focus();
		return false;
	}
	if (iform.personID.value=="") {
		alert("personID Required.");
		iform.personID.focus();
		return false;
	}
    iform.submit();
    refreshParent();
	return true;
  }

function refreshParent() {
    window.opener.location = "UserList.php{Session}";
	window.close();
}
function checkValues(which){
	if (which.userType.value=='') {
		alert('userType required');
		which.userType.focus();
		return false;
	}
	if (which.username.value=='') {
		alert('username required');
		which.username.focus();
		return false;
	}
	if (which.password.value=='') {
		alert('password required');
		which.password.focus();
		return false;
	}
	if (which.personID.value=='') {
		alert('personID required');
		which.personID.focus();
		return false;
	}
}

function setDefaults(){
	window.resizeTo(570,590);
}

</script>
</head>
<body bgcolor="#CCCCCC" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/background/bg_middle.jpg" onLoad="javascript: setDefaults();">
<form name="EncodeUser" method="post" action="UserEncode.php{Session}">
  <!-- BEGIN FORM -->
  <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>
        <table width="500" border="0" cellspacing="1" cellpadding="3" align="center">
          <tr>
            <td class="fileds_comment" colspan="3" bgcolor="#F6F6F6" nowrap><b>Encode User</b></td>
          </tr>
          
          <tr>
            <td class="fileds_comment" rowspan="2" bgcolor="#F6F6F6" nowrap align="right">
              <input type="hidden" name="userID" value="{userID}">
              User</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" size="30" name="number" maxlength="32" value="{username}">
              (Username) </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <select name="userType">
               <!-- BEGIN UserTypeList -->
               <option value="{userType}" {userType_sel}>{userType}</option>
               <!-- END UserTypeList -->
              </select>
              <br>(UserType)
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="password" name="password" size="30" maxlength="64" value="{password}">
              (Password) </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="password" name="confirmPassword" size="30" maxlength="64" value="{confirmPassword}">
              (Confirm Password) </td>
          </tr>

          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>LastName</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="hidden" name="personID" value="{personID}">
              <input type="text" name="lastName" maxlength="100" size="30" value="{lastName}">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>FirstName</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="text" name="firstName" maxlength="100" size="30" value="{firstName}">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>MiddleName</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="text" name="middleName" maxlength="100" size="30" value="{middleName}">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>Gender</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="radio" name="gender" value="male" {male}>
              male
              <input type="radio" name="gender" value="female" {female}>
              female </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>Birthday</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" colspan="2" align="left">
              <table border="0" cellspacing="0" cellpadding="2" width="100">
                <tr>
                  <td class="fileds_comment" width="33%">
                    <select name="birth_month" onChange="javascript:setDays()">
                      <!-- BEGIN MonthList -->
                      <option value = "{monthValue}" {birth_month_sel}>{month}</option>
                      <!-- END MonthList -->
                    </select>
                    (month)</td>
                  <td class="fileds_comment" width="33%">
                    <select name="birth_day">
                      <!-- BEGIN DayList -->
                      <option value = "{dayValue}" {birth_day_sel}>{dayValue}</option>
                      <!-- END DayList -->
                    </select>
                    (day)</td>
                  <td class="fileds_comment" width="33%">
                    <select name="birth_year" onChange="javascript:setDays()">
                      <!-- BEGIN YearList -->
                      <option value = "{yearValue}" {birth_year_sel}>{yearValue}</option>
                      <!-- END YearList -->
                    </select>
                    (year) </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" width="100" bgcolor="#F6F6F6" nowrap>Marital
              Status</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <!-- BEGIN MaritalStatusList -->
              <input type="radio" name="maritalStatus" value="{maritalStatusKey}"{maritalStatus_sel}>
              {maritalStatusValue}&nbsp;&nbsp;&nbsp;
              <!-- END MaritalStatusList -->
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" bgcolor="#F6F6F6" nowrap>TIN</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="tin" maxlength="32" size="30" value="{tin}">
            </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">&nbsp;</td>
          </tr>
          <tr>
            <td class="fileds_comment" rowspan="3" bgcolor="#F6F6F6" nowrap align="right">
              <input type="hidden" name="addressID" value="{addressID}">
              Address</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" size="30" name="number" maxlength="32" value="{number}">
              (Number) </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="street" size="30" maxlength="64" value="{street}">
              (Street) </td>
          </tr>
          <tr>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="barangay" size="30" maxlength="64" value="{barangay}">
              (Barangay) </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="district" size="30" maxlength="64" value="{district}">
              (District) </td>
          </tr>
          <tr>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="municipalityCity" size="30" maxlength="64" value="{municipalityCity}">
              (Municipality/City) </td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left">
              <input type="text" name="province" size="30" maxlength="32" value="{province}">
              (Province) </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" bgcolor="#F6F6F6" nowrap>Telephone</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="text" name="telephone" size="30" maxlength="64" value="{telephone}">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" bgcolor="#F6F6F6" nowrap>Cell
              Number</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="text" name="mobileNumber" size="30" maxlength="64" value="{mobileNumber}">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" align="right" bgcolor="#F6F6F6" nowrap>Email</td>
            <td class="fileds_comment" bgcolor="#F6F6F6" align="left" colspan="2">
              <input type="text" name="email" value="{email}" size="30">
            </td>
          </tr>
          <tr>
            <td class="fileds_comment" bgcolor="#F6F6F6" nowrap><b> </b></td>
            <td class="fileds_comment" bgcolor="#F6F6F6" colspan="2">
              <input type="hidden" name="formAction" value="save">
              <input type="hidden" name="personID" value="{personID}">
              <input type="hidden" name="ownerID" value="{ownerID}">
              <input type="hidden" name="odID" value="{odID}">
              <input type="submit" value="Submit" onClick="javascript:validateForm(this.form); return false;">
              <input type="reset" name="Submit2" value="Reset">
              <input type="button" name="Button" value="Cancel"  onClick="refreshParent();">
              <!--input type="button" name="Button" value="Cancel" onClick="javascript:EncodeUser.action.value = 'cancel';EncodeUser.submit();"-->
            </td>
          </tr>
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
  </table>
  <!-- END FORM -->

</form>
</body>
</html>
